unit KernelUnit;

interface
        uses Contnrs, classes;
type
  KernelClass = class(TObject)
  private
    { Private declarations }
    Name : String;
    inputTexturesList, outputTexturesList, cBuffers : TStrings;
  public
    (**
        The interface functions (Setters and Getters)
    *)
    procedure set_Name(Nam : String);
    function get_Name():String;

    procedure add_InputTexture(textureName : String);
    procedure add_OutputTexture(textureName : String);
    procedure add_ConstantBuffer(cBufferName : String);
    function get_InputTexture(index : Integer):String;
    function get_OutputTexture(index : Integer):String;
    function get_ConstantBuffer(index : Integer):String;

    function get_InputTexturesListSize():Integer;
    function get_OutputTexturesListSize():Integer;


    // The constructor
    Constructor Create(Nam: String);overload;
  end;

implementation

procedure KernelClass.set_Name(Nam : String);
begin
name := Nam;
end;

function KernelClass.get_Name() : String;
begin
result := Name;
end;

procedure KernelClass.add_InputTexture(textureName : String);
begin
inputTexturesList.Add(textureName);
end;

procedure KernelClass.add_OutputTexture(textureName : String);
begin
outputTexturesList.Add(textureName);
end;

procedure KernelClass.add_ConstantBuffer(cBufferName : String);
begin
cBuffers.Add(cBufferName);
end;

function KernelClass.get_InputTexture(index : Integer):String;
begin
if index >= inputTexturesList.Count then
  result := ''
else
  result := inputTexturesList.Strings[index];
end;

function KernelClass.get_OutputTexture(index : Integer):String;
begin
if index >= outputTexturesList.Count then
  result := ''
else
  result := outputTexturesList.Strings[index];
end;

function KernelClass.get_ConstantBuffer(index : Integer):String;
begin
if index >= cBuffers.Count then
  result := ''
else
  result := cBuffers.Strings[index];
end;

function KernelClass.get_InputTexturesListSize():Integer;
begin
  result := inputTexturesList.Count;
end;

function KernelClass.get_OutputTexturesListSize():Integer;
begin
  result := outputTexturesList.Count;
end;

Constructor KernelClass.Create(Nam: String);
begin
set_Name(Nam);
inputTexturesList := TStringList.Create;
outputTexturesList := TStringList.Create;
cBuffers := TStringList.Create;
end;

end.
